import Vue from 'vue'
import Router from 'vue-router'
const Home = () => import('@/components/Home')
const AboutUs = () => import('@/components/AboutUs')
const BusinessScope = () => import('@/components/BusinessScope')
const Preoject = () => import('@/components/Preoject')
const Contacts = () => import('@/components/Contacts')

Vue.use(Router)

export default new Router({
  mode: 'history',  // 去掉访问#
  base: 'junyi-web', // 添加项目路径访问
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home,
      meta: {
        requireAuth: false,
        title: '首页'
      }
    },
    {
      path: '/home',
      name: 'home',
      component: Home,
      meta: {
        requireAuth: true,
        title: 'Home'
      }
    },
    {
      path: '/aboutUs',
      name: 'aboutUs',
      component: AboutUs,
      meta: {
        requireAuth: true,
        title: 'AboutUs'
      }
    },
    {
      path: '/businessScope',
      name: 'businessScope',
      component: BusinessScope,
      meta: {
        requireAuth: true,
        title: '业务范围管理'
      }
    },
    {
      path: '/preoject',
      name: 'preoject',
      component: Preoject,
      meta: {
        requireAuth: true,
        title: '项目管理'
      }
    },
    {
      path: '/contacts',
      name: 'contacts',
      component: Contacts,
      meta: {
        requireAuth: true,
        title: '联系人管理'
      }
    }
  ]
})
